package register
{{$namespace := .Namespace}}
import (
{{- range $name, $agg := .Aggregates}}
    {{$agg.SnakeName}}_event "{{$namespace}}/pkg/cmd-service/domain/{{$agg.SnakeName}}/event"
{{- end}}
    "github.com/liuxd6825/dapr-go-ddd-sdk/restapp"
)

// 注册事件类型
var _eventTypes = make([]restapp.RegisterEventType, 0)

//
// GetRegisterEventType
// @Description: 获取所有事件类型
// @return []restapp.RegisterEventType
//
func GetRegisterEventType() []restapp.RegisterEventType {
	return _eventTypes
}

//
// AddEventType
// @Description: 增加事件类型
// @param ret
//
func AddEventType(ret ...restapp.RegisterEventType) {
	for _, r := range ret {
		_eventTypes = append(_eventTypes, r)
	}
}

//
// GetRegisterEventType
// @Description: 获取所有注册事件类型
// @return *[]restapp.RegisterEventType
//
func initEventType() {
    {{- range $name, $agg := .Aggregates}}
    AddEventType({{$agg.SnakeName}}_event.GetRegisterEventTypes()...)
    {{- end}}
}
